﻿using System.Reflection;
using System.Web.Mvc;

namespace Ctef.Web.Controllers
{
    public class VersionController : Controller
    {
        private string version;

        public VersionController()
        {
            version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }

        [OutputCache(CacheProfile = "Cache3Seconds")]
        public ActionResult Index()
        {
            ViewData["Version"] = version;
            return View();
        }

        protected override void HandleUnknownAction(string actionName)
        {
            ViewData["Version"] = version;
            this.View("Index").ExecuteResult(this.ControllerContext);
        }
    }
}
